import type { RouteConfig } from '../../typings/router';
import userController from '../controllers/user';

/**
 * 用户模块路由
 */
const userRoutes: RouteConfig[] = [
    {
        method: 'get',
        name: 'userInfo',
        path: '/user/info',
        middlewares: [userController.infoAction],
    },
    {
        method: 'get',
        name: 'userRetrieve',
        path: '/user/retrieve',
        middlewares: [userController.retrieveAction],
    },
    {
        method: 'post',
        name: 'userAdd',
        path: '/user/add',
        middlewares: [userController.addAction],
    },
    {
        method: 'put',
        name: 'userUpdate',
        path: '/user/update',
        middlewares: [userController.updateAction],
    },
    {
        method: 'delete',
        name: 'userDelete',
        path: '/user/delete',
        middlewares: [userController.deleteAction],
    },
    {
        method: 'put',
        name: 'userUpdatePwd',
        path: '/user/updatePwd',
        middlewares: [userController.updatePwdAction],
    },
    {
        method: 'put',
        name: 'userResetPwd',
        path: '/user/resetPwd',
        middlewares: [userController.resetPwdAction],
    },
    {
        method: 'put',
        name: 'userUploadAvatar',
        path: '/user/uploadAvatar',
        middlewares: [userController.uploadAvatarAction],
    },
];

export default userRoutes;
